package com.atguigu.gamll_sugar.mapper;

import com.atguigu.gamll_sugar.entity.ProvinceStats;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chenlongStart
 * @create 2021-07-07 18:43
 * @desc
 */
public interface ProvinceStatsMapper {
    @Select("SELECT \n" +
            "    province_name,\n" +
            "    sum(order_amount) AS order_amount,\n" +
            "    sum(order_count) AS order_count\n" +
            "FROM province_stats_2021\n" +
            "WHERE toYYYYMMDD(stt) = #{date}\n" +
            "GROUP BY province_name")
    List<ProvinceStats> getProvinceGMV(@Param("date") int date);
}
